package com.pxxy.mapper.impl;

import com.pxxy.entity.Student;
import com.pxxy.mapper.StudentMapper;
import org.apache.ibatis.session.SqlSession;

import java.io.Serializable;
import java.util.List;

/******************
 * @Author yejf
 * @Description TODO
 */
public class StudentMapperImpl implements StudentMapper {

    private SqlSession session;

    public StudentMapperImpl(SqlSession session) {
        this.session = session;
    }

    @Override
    public List<Student> findAll() {
        return session.selectList("findAll");
    }

    @Override
    public Student findById(Serializable id) {
        return session.selectOne("findById", id);
    }

    @Override
    public void save(Student student) {
        session.insert("save", student);
    }

    @Override
    public void update(Student student) {
        session.update("update", student);
    }

    @Override
    public void delete(Serializable id) {
        session.delete("delete", id);
    }
}
